//
//  HiAboutTextView.m
//  HiCar
//
//  Created by 丁一 on 2019/2/14.
//  Copyright © 2019 丁一. All rights reserved.
//

#import "HiAboutTextView.h"

@interface HiAboutTextView ()<UITextViewDelegate>

@end

@implementation HiAboutTextView

+ (HiAboutTextView *)show:(CGRect)frame{
    HiAboutTextView *showview = [[HiAboutTextView alloc] initWithFrame:frame];
    showview.backgroundColor  = [UIColor whiteColor];
    return showview;
}

- (instancetype)initWithFrame:(CGRect)frame{
    if (self=[super initWithFrame:frame]) {

        [self addSubview:self.textview];
        self.textview.frame = CGRectMake(5, 5, frame.size.width-10, frame.size.height-10-20);
        [self addSubview:self.textview.wordCountLabel];

        self.textview.wordCountLabel.frame = CGRectMake(10, frame.size.height-10-20, 200, 20);
    }
    return self;
}

- (UITextView *)textview{
    if (!_textview) {
        _textview                   = [[UITextView alloc] initWithFrame:CGRectMake(5, 5, RECRWITCH-20, 80)];
        _textview.delegate          = self;
        _textview.font              = [UIFont boldSystemFontOfSize:17];
        _textview.layer.borderColor = [UIColor clearColor].CGColor;
        _textview.limitLength       = @400;
    }
    return _textview;
}

@end
